home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / sillies / _yow / _help next >
Text File  |  1992-11-04  |  6KB  |  122 lines

  1. !Yow displays a random "fortune cooky", quotation or witicism in a
  2. window.  The window closes when you click SELECT or MENU in it or re-run
  3. !Yow.  Clicking ADJUST displays a new fortune.  If the desktop is not
  4. running !Yow just prints a text to the current output stream(s).
  5.  
  6. This program is Copyright © 1992 Denis Howe and may be distributed freely
  7. provided nothing is charged for it and this copyright notice is retained.
  8. Comments, suggestions for improvements and new texts etc. are welcome.
  9.  
  10. Denis Howe <dbh@doc.ic.ac.uk>    After all, all he did was string together
  11. 48 Anson Rd, London NW2 3UU      a lot of old, well-known quotations.
  12. +44 (81) 450 9448                        - H L Mencken, on Shakespeare
  13.  
  14. History
  15. -------
  16. See !RunImage for details of modifications.
  17.  
  18. The name !Yow was used by Ian Rawlings <ssurawls@uk.ac.rdg.susssys1> for
  19. his program which inspired this one (see below) but I have pretty much
  20. completely rewritten it as well as greatly extending the data file
  21. (YowLines).  I got the Garfield icons from a program called !Quotation by
  22. Roger Spooner, as well as some of the quotes.  Ian's !Yow is available from
  23. the Newcastle Info-Server <info-server@ncl.ac.uk> as "fortune" and
  24. !Quotation is called "quote" there.  Other texts come from Walther
  25. Schoonenberg <walther@econ.vu.nl>'s program !Cooky ("dcookie" on
  26. Newcastle), David K Barber (aka Nigelstache)
  27. <Barber_DK@P1.lancsp.ac.uk>'s program Cookie (Newcastle "cookie"),
  28. several versions of the Unix fortunes.dat file and a more recent file
  29. full of jokes mailled to me by Ian.
  30.  
  31. Algorithm
  32. ---------
  33. The program originally loaded the whole file into memory, picked a
  34. random text by its number within the file and then searched through
  35. memory for the Nth text.  No wonder Ian thought he wanted a better
  36. compiler, what he actually wanted was a better algorithm!
  37.  
  38. The program now sets the file pointer to a random byte offset within the
  39. file and searches back from there for the start of a text (or the start
  40. of the file).  This is more likely to pick a long text than a short one
  41. but this bias can be reduced by a tweak in !RunImage which is currently
  42. commented out.  A window is created in the middle of the screen and the
  43. text is printed in it, breaking lines at spaces if necessary.
  44.  
  45. Sort & Gen programs
  46. -------------------
  47. Two other programs are included in the !Yow application directory.
  48.  
  49. "Sort" sorts the data file to make it easier to spot duplicates when
  50. merging a new file of texts.
  51.  
  52. The second program, "Gen" is based on an idea from Scientific American.
  53. It generates random sequences of characters based on the frequency of
  54. occurence of strings of n characters in some example text (YowLines in
  55. this case).  The parameter "n" (Mem%) determines how many previous
  56. output characters the program remembers in order to choose the next one.
  57. If n=4 say, it searches YowLines randomly for an occurence of the last
  58. three characters output, looks at the character following them in the
  59. file, outputs it and shifts it onto it's memory FIFO (first-in
  60. first-out) buffer.  The effective value of "n" counts up from 1 (an
  61. initial \0 output is assumed) on start-up.  This process is equivalent
  62. to using frequency tables for all sequences of "n" characters.  That
  63. would run much faster but would take a long time to calculate the
  64. tables.
  65.  
  66. Ian's original documentation
  67. ----------------------------
  68. Snail Mail Address:
  69.       Ian Rawlings
  70.       St. Lawrence,
  71.       Salisbury Road,
  72.       West Wellow,
  73.       Near Romsey,
  74.       HANTS S051 6AP
  75.       Tel (0794) 22086
  76.  
  77. EMAIL address: ssurawls@uk.ac.rdg.susssys1
  78.  
  79. This is an Archified version of YOW on the IBM.  It is one of those
  80. hateful Fortune cookie programs that simply plonk a phrase at random
  81. onto the screen, the file of phrases in this case being taken from the
  82. IBM side thru' PCdir.  I don't know exactly who wrote the thing (apart
  83. from the fact that they obviously don't lead a very interesting life if
  84. they are prepared to sit down and write all that bumf) but the file from
  85. the IBM had a header that I have stripped for simplicity of programming,
  86. 'cos I'm not too good yet!  The header is included below for those
  87. interested.
  88.  
  89. It's American, so many of the phrases are not funny to us, and some of
  90. the phrases are obviously hilarious to the author but are totally lost
  91. on me.  Still, it does throw up some gems occasionally, eg "A Liberal
  92. is somebody too poor to be a Capitalist and too rich to be a Communist"
  93.  
  94. Due to the gumf that goes on, not even Archie basic V could get a good
  95. enough response time, so out of desperation I compiled it at a friends
  96. house using RISC basic from Silicon Vision.  After the heavy editing
  97. necessary to get the program to compile I ended up with a 22K file from
  98. an original of 2.6K, it needed 64K instead of 40K to run, and it also
  99. needs the Floating Point Emulator loaded!  It did run faster though,
  100. which has never happened before when using RISC basic.  Usually the
  101. program runs slower!  Could somebody PLEASE bring out a decent BASIC
  102. compiler?! 
  103.  
  104. My Bank Manager forced me to return my Memory Expansion to Diamond
  105. Computing.  I'd only had it for a week, but it really is missed!
  106.  
  107. The original header
  108. -------------------
  109. Zippy the pinhead data base.  The official copy of this is in the file
  110.  "MLY;YOW >" on MC.MIT.EDU
  111. Everything up to the first ascii \000 (`null') character is a comment.
  112. The file consits of zippy quotations (from various comic books and
  113.  strips by Bill Griffith) followed by a null character.
  114.  Newline chracters following a quotation are ignored and are present
  115.  only for readability.
  116. Have FUN!
  117. This file is currently used by:
  118.  * the FORTUNE program on MIT-OZ
  119.  * the m-x yow command in GNU Emacs.
  120.  * NIL (MIT Common Lisp)'s debugger
  121.  * something bandy wrote at LLL-CRG.
  122.